package com.sinosun.autotestmachine.tools.parser;

import java.util.ArrayList;
import java.util.List;

public class RunInformation {
	private boolean runFlag = false;
	private String taskID = null;
	private List<String> task = new ArrayList<String>();
	private boolean codeByNet = false;
	
	public RunInformation(boolean flag, String taskId) { 
		this.runFlag = flag;
		this.taskID = taskId;
		this.codeByNet = false;
	}
	
	public RunInformation() {
		this(false, new String(""));
	}
	
	public synchronized void setRunFlag(boolean runFlag) {
		this.runFlag = runFlag;
	}
	
	public synchronized boolean getRunFlag() {
		return this.runFlag;
	}
	
	public synchronized void setTaskId(String taskId) {
		this.taskID = taskId;
	}
	
	public synchronized String getTaskId() {
		return this.taskID;
	}
	
	public synchronized void setCodeByNet(boolean codeByNet) {
		this.codeByNet = codeByNet;
	}
	
	public boolean getCodeByNet() {
		return this.codeByNet;
	}
	
	public synchronized void setTasks(List<String> tasks) {
		this.task = tasks;
	}
	
	public synchronized void addTask(String task) {
		if (this.task != null) {
			this.task.add(task);
		}
	}
	
	public synchronized List<String> getTasks() {
		return this.task;
	}
	
	public synchronized void clearTasks() {
		this.task.clear();
	}
}
